package com.gregbugaj.nscaffold.generator.artifact;

import java.io.File;

/**
 * Artifact are file level object ex: POJO, JSF files, templates etc
 * @author gbugaj
 *
 */
public abstract class Artifact {
	protected  String name;
	protected File root;
	private String content;
	
	/**
	 * Get the type of current artifact 
	 * @return
	 */
	public abstract ArtifactType getType();

	public String getName() {	
		return name;
	}

	public String getSimpleName() {
		String[] names=name.split("\\.");
		return names[names.length-1];
	}
	
	
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Render the artifact
	 * @param webcontentRoot 
	 */
	public  abstract void render();

	public  abstract File getOutputRoot();
	
	public File getRoot() {
		return root;
	}

	public void setRoot(File root) {
		this.root = root;
	}

	public void setContent(String content) {
		this.content=content;
	}

	public String getContent() {
		return content;
	}
}
